/*
 * Created by kingphone_he on 2019/8/15
 */

const DefaultPasteboardContent = [];

class Pasteboard {

    constructor() {
    }

    get content() {
        if (!this._content) {
            this._content = DefaultPasteboardContent;
        }
        return this._content;
    }

    set content(value) {
        this._content = value;
    }

    setContent(items) {
        this.content = [...items];
    }

    get type() {
        return this._type;
    }

    set type(value) {
        this._type = value;
    }

    get extra() {
        if (!this._extra) {
            this._extra = {};
        }
        return this._extra;
    }

    set extra(value) {
        this._extra = value;
    }

    clear() {
        this.extra = null;
        this.content = DefaultPasteboardContent;
    }
}

module.exports = {
    Pasteboard
};